﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Common.Model;
using System.Data.Objects.DataClasses;
using Common.Services;

namespace Common.UI.EM.Views.Interfaces
{
    public interface IDetailPresentationModel<S, E, C, EV>
        where S : IGenericEntityManagerService<E, C, EV>
        where E : EntityObject
        where C : CriteriaEntity
        where EV : ViewEntity
    {

        DetailMode Mode
        {
            get;
            set;
        }

        IDetailView View
        {
            get;
            set;
        }

        void LoadEntity(Guid id);

        void LoadEntity(EV ev);

        void LoadEntity(E entity);

        event CancelCalledEventHandler CancelCalled;
        event SaveCalledEventHandler SaveCalled;

    }

    public enum DetailMode
    {
        View = 0,
        Add = 1,
        Modify = 2,
        Delete = 3
    }
}